package model

//go routine 信道
type Channel struct {
	appName       string
	ProcessorStop chan bool
	AllTaskStop   chan bool

	TaskProceed chan *Task
	TaskSuccess chan *Task
	TaskFail    chan *Task
	TaskEnd     chan *Task
}

func NewChannel(appName string) *Channel {
	var ch = new(Channel)
	ch.appName = appName
	//processor Channel
	ch.ProcessorStop = make(chan bool)

	//task Channel
	ch.AllTaskStop = make(chan bool, 1)
	ch.TaskProceed = make(chan *Task, 1)
	ch.TaskSuccess = make(chan *Task, 1)
	ch.TaskFail = make(chan *Task, 1)
	ch.TaskEnd = make(chan *Task, 1)
	return ch
}
